<%@ page language="java" import="weaver.conn.RecordSet" pageEncoding="UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.hrm.cachecenter.bean.RolemembersComInfo" %>
<%@ page import="weaver.systeminfo.systemright.CheckUserRight" %>
<%--流程退回调用QMS接口--%>
<%
    try {
        RecordSet rs = new RecordSet();
        String departmentid = Util.null2String(request.getParameter("departmentid"));
        String roleid = Util.null2String(request.getParameter("roleid"));
        rs.executeUpdate("delete from HrmRoleMembers where roleid=?", roleid);
        rs.executeQuery("select id from hrmresource where departmentid=?",departmentid);
        while (rs.next()){
            String resourceid =Util.null2String(rs.getString("id"));
            String sql = " INSERT INTO HrmRoleMembers ( roleid ,resourceid ,rolelevel ,resourcetype)  VALUES  (?,?,?,?)";
            rs.executeUpdate(sql, roleid,resourceid,"2","1");
        }
        RolemembersComInfo rolemembersComInfo = new RolemembersComInfo();
        CheckUserRight checkUserRight = new CheckUserRight();
        checkUserRight.removeMemberRoleCache();
        checkUserRight.removeRoleRightdetailCache();
        rolemembersComInfo.removeCache();
    } catch (Exception e) {
        e.printStackTrace();
    }
%>




